<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>修改密码</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.css">    <!-- 自定义样式 -->
    <link rel="stylesheet" type="text/css" href="/css/changePassword.css">    <!-- 自定义样式 -->

</head>

<body>
<div class="A1">
    <header class="B1">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="C1">
                        <nav class="navbar navbar-expand-lg navbar-light bg-light">
                            <a class="navbar-brand" href="#">[[${session.users.username}]]</a>
                            <button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse"
                                    data-bs-target="#navbarNav"
                                    aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                                <span class="navbar-toggler-icon"></span>
                            </button>
                            <div class="navbar-collapse collapse" id="navbarNav">
                                <ul class="navbar-nav ml-auto">
                                    <li class="nav-item ">
                                        <a class="nav-link" href="/index">首页</a>
                                    </li>
                                    <li class="nav-item ">
                                        <a class="nav-link" onclick="redirectToBooks()">书籍</a>
                                    </li>
                                    <li class="nav-item active">
                                        <a class="nav-link" href="/changePassword">修改密码</a>
                                    </li>
                                    <li class="nav-item logout">
                                        <a class="nav-link" onclick="logout()">退出登录</a>
                                    </li>
                                </ul>
                            </div>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <div class="B2">
        <div class="container">
            <div class="row">
                <div class="col-md-6 mx-auto">
                    <div class="card card-body">
                        <h3 class="text-center">修改密码</h3>
                        <div class="mb-3">
                            <p class="text-center">当前用户：[[${session.users.username}]]</p>
                        </div>
                        <form>
                            <div class="mb-3">
                                <label for="currentPassword" class="form-label">当前密码</label>
                                <input type="password" class="form-control" id="currentPassword" required>
                            </div>
                            <div class="mb-3">
                                <label for="newPassword" class="form-label">新密码</label>
                                <input type="password" class="form-control" id="newPassword" required>
                            </div>
                            <div class="mb-3">
                                <label for="confirmPassword" class="form-label">确认新密码</label>
                                <input type="password" class="form-control" id="confirmPassword" required>
                            </div>
                            <button type="button" class="btn btn-danger" onclick="handleChangePassword()">修改密码</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Bootstrap JS -->
<script src="/js/jquery3.7.1.js"></script>
<!--<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>没用到，
用于处理弹出框、下拉菜单等组件的定位和偏移-->
<script src="/js/bootstrap5.3.0.js"></script>
<script src="/js/axios.min.js"></script>
<script src="/js/changePassword.js"></script>
<script>
    window.userData = {//使用嵌入式JSON数据传递
        id: '[[${session.users.id}]]',
        password: '[[${session.users.password}]]',
        name: '[[${session.users.username}]]'
    };
</script>
</body>

</html>